package cn.tangsihai.basic.util;

import lombok.Data;

/**
 * 操作结果返回
 */
@Data
public class AjaxResult {
    private Boolean success = true;
    private String msg = "操作成功";
    private Object resultObj;
    public static AjaxResult me(){
        return new AjaxResult();
    }

//    public void setSuccess(Boolean success) {
//        this.success = success;
//    }

    // 方便链式操作
    public AjaxResult setMsg(String msg) {
        this.success = false;
        this.msg = msg;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
